import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import store from './store'

import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);

import router from './router'

Vue.config.productionTip = false

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}

router.beforeEach((to, from, next) => {
  if (typeof to.query._t !== "undefined") {
    next();
  } else {
    to.query._t = new Date().getTime().toString();
    next(to);
  }
})


new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app')

